package com.lgy.web.controller;

import java.util.ArrayList;
import java.util.List;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/test")
@Api(description = "用户相关接口文档")
public class TestController {
	private static Logger logger = Logger.getLogger(TestController.class);

	@RequestMapping("")
	@ApiOperation(value="接口说明(测试)",httpMethod="GET",notes="测试页面")
	public String test() {
		logger.debug("this is message test");
		return "main";
	}

	@RequestMapping("selectUser")
	@ResponseBody
	@ApiOperation(value="接口说明(选择用户)",consumes="application/x-www-form-urlencoded",httpMethod="GET",notes="选择一个用户")
	public List<String> selectUser(@RequestParam String username) {
		List<String> data = new ArrayList<>();
		data.add("aaa");
		data.add("bbb");
		data.add(username);
		return data;
	}
	

}
